//Sat Mar 19 09:39:15 CDT 2011
#include <vector>
#include <list>
#include <map>
#include <set>
#include <deque>
#include <queue>
#include <stack>
#include <bitset>
#include <algorithm>
#include <functional>
#include <numeric>
#include <utility>
#include <sstream>
#include <iostream>
#include <iomanip>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cctype>
#include <string>
#include <cstring>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <ctime>

using namespace std;

class SRMCards
{
public:

    int maxTurns(vector <int> cards)
    {
        sort(cards.begin(), cards.end());
        int count = 0;
        while (cards.empty() == false)
        {
            count++;
            int tmp = cards[0];
            cards.erase(cards.begin());
            if (cards.empty()) return count;
            if (abs(cards[0] - tmp) <= 1)
                cards.erase(cards.begin());
        }
        return count;
    }
};
